import { PublishOptions, SubscribeOptions, MessageConsumeModel, AMQPAPI } from './../src/index';

import EventBus from './../src/index';
console.log('begin test')

EventBus.Subscribe<any>('defualt', 'dead_letter_queue', (message, mqMsg) => {

    var death = mqMsg.properties['headers']['x-death'][0]
    var count = death.count
    var reason = death.reason
    var queue = death.queue
    var time = death.time
    var exchange = death.exchange
    var routing_keys = death['routing-keys']

    var mqApi: AMQPAPI = ((EventBus as any) as AMQPAPI)
    return mqApi.SendToQueue('defualt', queue, mqMsg.content, mqMsg.properties)

}, { FalilMessageReQueue: true, BasicQOS: 4 })